<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>日期对象 </title>
<script type="text/javascript">
 var mydate=new Date();
  document.write("当前时间："+mydate+"<br>");
  mydate.setTime( mydate.getTime()+ 2* 60 * 60 * 1000);
  document.write("推迟二小时时间：" + mydate);
</script>
</head>
<body>
<script type="text/javascript">
var mystr="Hello World!";
document.write(mystr.substr(6)+ "<br />");
document.write(mystr.substr(0,5));
document.write(Math.round(Math.random()*10));
</script>
</body>
</html>